package com.stylismo.intellij.inspection.groovy;

import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;

/**
 * Name: GroovyAddPackageInfoWithNullabilityDefaultsFix<br>
 * User: Yao<br>
 * Date: 2017/11/5<br>
 * Time: 01:19<br>
 */
public class GroovyAddPackageInfoWithNullabilityDefaultsFix extends GroovyFix {

    @Override
    protected void doFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) throws IncorrectOperationException {
        final PsiElement psiElement = problemDescriptor.getPsiElement();
        if (psiElement instanceof GrField) {

            return;
        }
        if (psiElement instanceof GrMethod) {

            return;
        }
        if (psiElement instanceof GrParameter) {

            return;
        }

    }

    /**
     * @return text to appear in "Apply Fix" popup when multiple Quick Fixes exist (in the results of batch code inspection). For example,
     * if the name of the quickfix is "Create template &lt;filename&gt", the return value of getFamilyName() should be "Create template".
     * If the name of the quickfix does not depend on a specific element, simply return getName().
     */
    @Nls
    @NotNull
    @Override
    public String getFamilyName() {
        return "fix nullable problem ";
    }
}
